/*
 * @Description: 
 * @Author: lwx
 * @Date: 2022-06-16 11:06:45
 * @LastEditors: lwx
 * @LastEditTime: 2022-06-20 17:29:44
 */
export const timerMixins = {
    data() {
        return {
            timer: null
        }
    },
    created() {
        this.initData()
        if (this.timer) {
            clearInterval(this.timer)
        } else {
            this.timer = setInterval(() => {
                this.initData()
            }, 1000 * 100)
        }
    },
    destroyed() {
        clearInterval(this.timer)
        this.timer = null
    },
}